package package1;
import java.awt.Color;
import java.awt.geom.Point2D;
import java.util.ArrayList;

public class Function 
{
	private ArrayList<Point2D.Double> points = new ArrayList<Point2D.Double>();
	
	private int pointSize; // Point size;
	
	private Color pointColor;
	private Color lineColor;
	private Color areaColor;
	
	private boolean hide = false;
	private boolean fillPoint = true;
	private boolean showLine = true;	
	private boolean showArea = true;
	private boolean fillArea = false;
	
	private int areaStep = 5;
	
	public ArrayList<Point2D.Double> getPoints() 
	{
		return points;
	}
	
	public boolean isHide()
	{
		return this.hide;
	}

	public int getPointSize() 
	{
		return pointSize;
	}

	public Color getPointColor() 
	{
		return pointColor;
	}

	public Color getLineColor() 
	{
		return lineColor;
	}

	public Color getAreaColor()
	{
		return areaColor;
	}

	public boolean isFillPoint() 
	{
		return fillPoint;
	}

	public boolean isShowLine() 
	{
		return showLine;
	}

	public boolean isShowArea() 
	{
		return showArea;
	}

	public boolean isFillArea() 
	{
		return fillArea;
	}

	public int getAreaStep() 
	{
		return areaStep;
	}
	
	public void setHide(boolean hide)
	{
		this.hide = hide;
	}

	public void setPointsSize(int pointSize)
	{
		this.pointSize = pointSize;
	}
	
	public void setPointsColor(Color pointColor)
	{
		this.pointColor = pointColor;
	}
	
	public void setFillPoint(boolean fillPoint)
	{
		this.fillPoint = fillPoint;
	}
	
	public void setShowLine(boolean showLine)
	{
		this.showLine = showLine;
	}
	
	public void setLineColor(Color lineColor)
	{
		this.lineColor = lineColor;
	}
	
	public void setShowArea(boolean showArea)
	{
		this.showArea = showArea;
	}
	
	public void setAreaStep(int areaStep)
	{
		this.areaStep = areaStep;
	}
	
	public void setAreaColor(Color areaColor, double alpha)
	{
		this.areaColor = new Color(areaColor.getRed(), areaColor.getGreen(), areaColor.getBlue(), (int)(255 * alpha));
	}
	
	public void setFillArea(boolean fillArea)
	{
		this.fillArea = fillArea;
	}
	
	public void addPoint(double x, double y)
	{
		Point2D.Double point = new Point2D.Double(x, y);
		this.points.add(point);
	}
	
	public void clearPoints()
	{
		this.points.clear();
	}
}
